//
//  OneViewController.m
//  5-31学习
//
//  Created by 钟纪旺 on 16/5/31.
//  Copyright © 2016年 zjw. All rights reserved.
//

#import "OneViewController.h"

@interface OneViewController ()
@end

@implementation OneViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationController.title = @"too";
    self.view.backgroundColor = [UIColor orangeColor];
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
    //设置按钮
    UIButton *btn =[UIButton buttonWithType:UIButtonTypeSystem];
    //使用文字设置
    [btn setTitle:@"按钮" forState:UIControlStateNormal];
    [btn setTitle:@"按下去了" forState:UIControlStateHighlighted];
    [btn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    //用本地图片设置按钮
//   [btn setImage:[UIImage imageNamed:@"2"] forState:UIControlStateNormal];
    //设置宽度
    btn.layer.borderWidth = 1;
    //边框设置为圆角
    btn.layer.cornerRadius = 6;
    //设置宽与高
    btn.frame = CGRectMake(0, 0, 144, 44);
    btn.center = CGPointMake(self.view.frame.size.width/2, 100);
    [btn addTarget:self action:@selector(omg:) forControlEvents:UIControlEventTouchUpInside];
    [btn addTarget:self action:@selector(omg2:) forControlEvents:UIControlEventTouchDown];
    [self.view addSubview:btn];
    
    
    
}
- (void)omg:(UIButton *)sender{
    sender.backgroundColor =[UIColor greenColor];




}
- (void)omg2:(UIButton *)sender{
    sender.backgroundColor =[UIColor blueColor];
    
    
    
    
}
//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
//
//
//    return 1;
//
//}
//-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
//    UITableViewCell *cell =[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
////    if (!tf) {
////        tf = [UITextField alloc] initWithFrame:CGRectMake(0, 0, self.view.frame, 44);
////    }
////
//
//
////}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
